
<template tag="以下文档内容为hycli自动生成">
  <div>
  <el-dialog
    v-model="conf.visible"
    :title="title"
    draggable
    align-center="true"
    width="68%"
    :close-on-click-modal="false"

  >
    <el-tabs v-model="conf.selected">
      <el-tab-pane label="详情" name="aaarn">
<el-row :gutter="24" style="font-size: 0.7rem;">
  <el-col :span="4" class="text-right" style="min-height:26px">系统编号:</el-col>
  <el-col :span="8" v-text="view.id||'-'" style="min-height:26px" ></el-col>
  <el-col :span="4" class="text-right" style="min-height:26px">LOGO:</el-col>
  <el-col :span="8" v-text="view.logo||'-'" style="min-height:26px" ></el-col>
  <el-col :span="4" class="text-right" style="min-height:26px">系统名称:</el-col>
  <el-col :span="8" v-text="view.name||'-'" style="min-height:26px" ></el-col>
  <el-col :span="4" class="text-right" style="min-height:26px">唯一标识:</el-col>
  <el-col :span="8" v-text="view.ident||'-'" style="min-height:26px" ></el-col>
  <el-col :span="4" class="text-right" style="min-height:26px">首页地址:</el-col>
  <el-col :span="8">
  <el-link target="_blank" type="success" v-if="view.index_url" :href="view.index_url" :title="view.index_url">查看</el-link> 
  </el-col>
  <el-col :span="4" class="text-right" style="min-height:26px">登录地址:</el-col>
  <el-col :span="8" v-text="view.login_url||'-'" style="min-height:26px" ></el-col>
  <el-col :span="4" class="text-right" style="min-height:26px">主题样式:</el-col>
  <el-col :span="8" v-text="view.theme||'-'" style="min-height:26px" ></el-col>
  <el-col :span="4" class="text-right" style="min-height:26px">背景图片:</el-col>
  <el-col :span="8" v-text="view.bg_url||'-'" style="min-height:26px" ></el-col>
  <el-col :span="4" class="text-right" style="min-height:26px">状态:</el-col>
  <el-col :span="8" v-text="view.status_label" style="min-height:26px" ></el-col>
</el-row>
      </el-tab-pane>
        <el-tab-pane label="菜单权限" name="aaarm"  @tab-click="show_view_aaarm">
          <el-row>
            <el-col :span="24" class="text-right">
          <el-button type="success" icon="Plus"
           round  @click="show_cmpnt_aabea">添加根节点</el-button>
        </el-col>
          </el-row>
<div class="list">
    <el-table :data="dataList_aaarm" row-key="id" 
    
    v-loading="conf.loading" stripe 
        style="width: 100%;height:300px" 
         empty-text="无数据">le
        
        	<!--id text -->
        <el-table-column  show-overflow-tooltip    align="center" label="编号" >
            <template #default="scope">
                  <span>{{ scope.row.id||'-' }}</span>
              </template>
        </el-table-column>
        	<!--icon icon -->
        <el-table-column   prop="icon" align="right" label="图标">
            <template #default="scope">
                <i :class="scope.row.icon"></i>
            </template>
        </el-table-column>
        	<!--sys_id select -->
        <el-table-column   v-if="$size.gt('m')"    prop="sys_id" align="center" label="系统">
            <template #default="scope">
                <span 
                    v-text="scope.row.sys_id_label"></span>
            </template>
        </el-table-column>
        	<!--name text -->
        <el-table-column  show-overflow-tooltip   min-width="80"   align="left" label="名称" >
            <template #default="scope">
                  <span>{{ scope.row.name||'-' }}</span>
              </template>
        </el-table-column>
        	<!--url text -->
        <el-table-column  show-overflow-tooltip    align="center" label="地址标识" >
            <template #default="scope">
                  <span>{{ scope.row.url||'-' }}</span>
              </template>
        </el-table-column>
        	<!--status tag -->
        <el-table-column    prop="status" align="center" label="状态">
            <template #default="scope">
                <el-tag :type="$js.page.tagColor(scope.row.status,'status')" round v-text="scope.row.status_label"  ></el-tag>
            </template>
        </el-table-column>
        	<!--create_time date -->
        <el-table-column  show-overflow-tooltip    align="center" label="创建时间" >
            <template #default="scope">
                  <span>{{ scope.row.create_time||'-' }}</span>
              </template>
        </el-table-column>

<el-table-column fixed="right" align="center" label="操作" width="168">
    <template #default="scope">
        <div class="opts">
            <el-button   type="text" @click="show_cmpnt_aabeb(scope.row)" >子节 </el-button>
            <el-button   type="text" @click="show_cmpnt_aabec(scope.row)" >编辑 </el-button>
            <el-button   type="text" @click="show_cmpnt_aaasf(scope.row)" >删除 </el-button>
        </div>
    </template>
</el-table-column>
    </el-table>
</div>
         </el-tab-pane>
    </el-tabs>
    <template #footer>
      <span style="height: 60px"> </span>
    </template>
    <aabea ref="cmpnt_aabea" @onsaved="show(form)"></aabea>
    <aabeb ref="cmpnt_aabeb" @onsaved="show(form)"></aabeb>
    <aabec ref="cmpnt_aabec" @onsaved="show(form)"></aabec>
    <aaasf ref="cmpnt_aaasf" @onsaved="show(form)"></aaasf>
  </el-dialog>
</div>
</template>
<script>
import gantt from "@/views/cmpnts/gantt.vue"
import aabea from "@/views/sso/system/system_menu.add"
import aabeb from "@/views/sso/system/system_menu.add"
import aabec from "@/views/sso/system/system_menu.edit"
import aaasf from "@/views/sso/system/system_menu.cnfrm"
export default {
   components: {
    gantt,
    aabea,
    aabeb,
    aabec,
    aaasf,
  },
  data() {
    return {
        conf:{
        visible:false,
        
        selected:"aaarm",
      },
      title:"系统信息详情",
      form:{},
        form_aaarm: {
            pi: 1,
            ps: 15,
            disabled:false,
            single_date_range_name:"",
            single_date_range_value:[],
            single_text_name:"",
            single_text_value:"",
            sys_id:"",
            },
            sys_idList:[],
            parentList:[],
            menu_typeList:[],
            is_openList:[],
            statusList:[],
            dataList_aaarm:[],
            multiQueryDateRange:[],
            multiQueryText:[],
            total_aaarm:0,
            note_dataList:[],
      view: {
        id:"",
        logo:"",
        name:"",
        ident:"",
        index_url:"",
        login_url:"",
        theme:"",
        bg_url:"",
        status:"",
        },
      }
  },
  methods: {
  show_cmpnt_aabea(fm = {}){
    let form = Object.assign({},this.form)
    form = Object.assign(form,fm)
    form.is_open = "0"
    form.menu_type = "1"
    form.parent = "0"
    form.sortrank = "1"
    form.status = "0"
    this.$refs.cmpnt_aabea.show(form)
  },
  show_cmpnt_aabeb(fm = {}){
    let form = Object.assign({},this.form)
    form = Object.assign(form,fm)
    form.icon = ""
    form.name = ""
    form.parent = fm.id
    form.url = ""
    this.$refs.cmpnt_aabeb.show(form)
  },
  show_cmpnt_aabec(fm = {}){
    let form = Object.assign({},this.form)
    form = Object.assign(form,fm)
    this.$refs.cmpnt_aabec.show(form)
  },
  show_cmpnt_aaasf(fm = {}){
    let form = Object.assign({},this.form)
    form = Object.assign(form,fm)
    this.$refs.cmpnt_aaasf.show_aaasf(form)
  },
  show_cmpnt_aaarl(fm = {}){
    let form = Object.assign({},this.form)
    form = Object.assign(form,fm)
    form.status = "0"
    this.$refs.cmpnt_aaarl.show(form)
  },
  show_cmpnt_aaarj(fm = {}){
    let form = Object.assign({},this.form)
    form = Object.assign(form,fm)
    this.$refs.cmpnt_aaarj.show(form)
  },
  show_cmpnt_aaark(fm = {}){
    let form = Object.assign({},this.form)
    form = Object.assign(form,fm)
    this.$refs.cmpnt_aaark.show(form)
  },
 show(form) {
    this.conf.visible = true
    this.form = form
    //菜单权限查询
    let nform_aaarm = {}
    this.queryData_aaarm(form,nform_aaarm)
   let that = this;
   this.$theia.http
      .get("/sso/system/info",form)
      .then((res) => {
        let item = Object.assign({}, res)
        item.status_label = that.$theia.enum.getName("status",item.status)
        that.view = item
      })
      .catch((res) => {
        let code = res.response.status;
        let msg = `系统信息查询失败(${code})`;
        that.$notify.error({ title: "失败", message: msg, duration: 5000 });
      });
  },

queryData_aaarm(mform = {},nform={}){
    //构建查询参数
    let queryForm = Object.assign({},this.form_aaarm)
    queryForm = Object.assign(queryForm,nform||{})
    
    //处理多个日期选择
    queryForm[this.form_aaarm.single_date_range_name] = this.form_aaarm.single_date_range_value
    queryForm[this.form_aaarm.single_text_name] = this.form_aaarm.single_text_value
   
    //处理日期范围选择

    queryForm[this.form_aaarm.single_date_range_name] = null
    queryForm.single_date_range_value = null
    queryForm.single_date_range_name = null

    queryForm.single_text_value = null
    queryForm.single_text_name = null
 
    //处理关联表system_menu system_info system_menu
    queryForm.sys_id = mform.id
   
    //发送查询请求
    let that = this
    that.conf.loading = true
    queryForm.ps = 100
    //构建统计查询
  //数据查询
  this.$theia.http.get("/sso/system/menu/query",queryForm).then(res=>{
      if((res.items||[]).length < (queryForm.ps||10)){
        that.form_aaarm.disabled = true
      }
      that.conf.loading = false
      that.dataList_aaarm = res.items||[]
      that.total_aaarm = res.count
      that.resetItemData_aaarm(that,that.dataList_aaarm)
    });
  },

  resetItemData_aaarm(that,lst){
    lst.forEach(item => {
      item.__raw = Object.assign({}, item)
    item.sys_id_label = that.$theia.enum.getName("system_info",item.sys_id)
    item.status_label = that.$theia.enum.getName("status",item.status)
    item.id_progress = item.id
    item.icon_progress = item.icon
    item.sys_id_progress = item.sys_id
    item.name_progress = item.name
    item.url_progress = item.url
    item.status_progress = item.status
    item.create_time_progress = item.create_time
    item.create_time = that.$theia.str.dateFormat(item.create_time,'MM/dd')
    if(item.children){
      that.resetItemData_aaarm(that,item.children)
    }
  });
  },
    loadEnums_aaarm(){
        //系统
        this.sys_idList = this.$theia.enum.get("system_info","","" ,false,"")
        //系统
        this.sys_idList = this.$theia.enum.get("system_info","","" ,false,"")
        //状态
        this.statusList = this.$theia.enum.get("status","","" ,false,"")
    },

  },
};
</script>
<style scoped>
/deep/.el-step__title{
    font-size: 0.8rem;
}
.steps{
  margin-top:8px;
  margin-bottom:  16px;
}
</style>